
% function
f = @(x) (x.*exp(-abs(x)));

% time domain
a = -10; b=10; N =1000;

% frequency domain
c = -10; d=10; M = 1000;

%% FT of function
t = linspace(a, b, N+1);
ft = f(t);
[F, w]=ffft(ft,a,b,N,c,d,M);

plot(t, ft, w,real(F), '-r', w,imag(F), '--r');
legend('Original Function', 'Real Part of FT', 'Image Part of FT');

%% Window FT

support = [-1,1];NN=1000;
N=100;M=100;
window = @(x)(1-x.^2);
[F, ts, ws]=wft(f, window, support,NN,a,b,N,c,d,M);
mesh(ts, ws, real(F));
xlabel('t');
ylabel('\omega')